import 'package:flutter/material.dart';

class TextGroup extends StatefulWidget{
  final String lebal;
  final String content;
  const TextGroup({super.key,required this.lebal,required this.content});

  @override
  State<TextGroup> createState() => _TextGroupState();
}

class _TextGroupState extends State<TextGroup> {
  final TextEditingController _controller = TextEditingController();
  @override
  void initState(){
    super.initState();
    _controller.text=this.widget.content;
  }
  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Row(
          crossAxisAlignment: CrossAxisAlignment.start,
          children: [
            Expanded(
              flex: 2,
              child: Padding(
                padding: const EdgeInsets.fromLTRB(5,10,2,2),
                child: Text(
                  widget.lebal,
                  style: const TextStyle(
                    fontSize: 14,
                  ),
                ),
              ),
            ),
            // const SizedBox(width: 2,),
            Flexible(
              flex: 5,
              // constraints: const BoxConstraints(maxHeight: 100,maxWidth: ),
              child: SingleChildScrollView(
                // padding: const EdgeInsets.fromLTRB(2,2,10,2),
                // child: TextField(
                //   // content,
                //   controller: _controller,
                //   style: const TextStyle(
                //     fontSize: 16
                //   ),
                // ),
                child: SizedBox(
                  width: MediaQuery.of(context).size.width * 0.7,
                  // decoration:const BoxDecoration(
                  //   border: Border(
                  //     bottom: BorderSide(
                  //       color: Colors.black26, // 设置底部边框的颜色
                  //       width: 1.0, // 设置底部边框的宽度
                  //     )
                  //   )
                  // ),
                  child: const Padding(
                    padding: EdgeInsets.fromLTRB(5, 2, 5, 2),
                    child: Text('123',style: TextStyle(fontSize: 16),),
                  ),
                ),
              ),
            ),
          ],
        ),
        const Divider(color: Colors.black12,height: 0.7,)
      ],
    );
  }
}